import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 套餐信息
 */
@Entity('package_info')
export class PackageInfoEntity extends BaseEntity {
  @Index()
  @Column({ comment: '名称', length: 50 })
  name: string;

  @Column({ comment: '价格', type: 'decimal', precision: 10, scale: 2, default: 0 })
  price: number;

  @Column({ comment: '原价', type: 'decimal', precision: 10, scale: 2, default: 0 })
  originalPrice: number;

  @Column({ comment: '有效期开始时间', type: 'date', nullable: true })
  startTimeDate: Date;

  @Column({ comment: '套餐类型', dict: 'packageType', nullable: true })
  packageType: number;

  @Column({ comment: '有效期结束时间', type: 'date', nullable: true })
  endTimeDate: Date;

  @Column({ comment: '状态', dict: ['下架', '上架', '售罄'], default: 1 })
  status: number;

  @Column({ comment: '商品IDS', type: 'json', nullable: true })
  ProductIds: number[];

  @Column({ comment: '套餐描述', type: 'text', nullable: true })
  description: string;

  @Column({ comment: '备注', nullable: true })
  remark: string;
}
